Content starts here Add a Condition
This page last changed on Feb 26, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Add a Condition to an Update Block

This topic describes how to add a condition to an update block in an update map.

Overview

In the update map, you can override an Update block by defining conditions in the expression editor that determine when the block is updated. 

A Condition in the Expression Editor

A condition is a Boolean expression based on XQuery functions and values defined in the update map, for example:

fn-bea:value($CUSTOMER/CUSTOMER_ORDER/TOTAL_ORDER_AMT) > 1000

For example, you might have a logical data service with a return type that combines Customer, Order, and CreditRating data. Each customer can have multiple orders and one credit rating.

Return Type with Customer, Order, and CreditRating Data

Example

In the update map, you may want to set a condition that a customer's credit rating can only be updated if the customer places an order with an amount greater than 1000.00.

To set an update map condition:

  1. Click the Update Map tab.
  2. Click the update block on the left that contains the element for which you want to set the condition (for example, the CREDITRATING box for the CREDITRATING/RATING element).
    You can now enter a condition in the expression editor.
     

  3. Enter a condition in the Condition box, for example:
    fn-bea:value($CUSTOMER/CUSTOMER_ORDER/TOTAL_ORDER_AMT) > 1000.00
  4. Save the data service.
  5. Click the Test tab.
    The logical data service returns data that looks like this:
     

  6. Run a read function, then click Edit and attempt to submit a value for the element that has the condition.
    When you test the update map, you can only update the CREDITRATING data source if TOTAL_ORDER_AMT for any of the customer's orders is greater than 1000.00.

See Also

Concepts
How Tos
Other Resources



Document generated by Confluence on Apr 28, 2008 15:57